Repository navigation
fix(id): compacted tag fold falls back to the reference on cyclic parents graphs (#6709) - #6736
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6709.
Problem
compacted_claimsand the referencelive_claimswere documented as unconditionally equal, but on a cyclicparentsgraph the one-pass DFS fold's answer flipped withHashMapiteration order (theopenset silently drops a back-edge; whichever of a set/clear pair folds second decides). Verified repro in the issue: set 1, clear 2 naming 1, parents1->[2],2->[1]— reference removes the claim; the compacted fold kept it in 5 of 12 processes.Fix shape (chosen explicitly, documented in
tag_claims.rs)parents_have_cycle: an iterative three-color DFS over every node the graph names (keys and named parents), O(V+E), deterministic.compacted_claimschecks for a cycle up front and, if one exists, folds the whole input withlive_claims— equivalence by construction, no iteration-order dependence. On acyclic inputs (every input the store can produce: an event ID is a hash of the bytes naming its parents, so a cycle would require a hash cycle) the fast one-pass fold is unchanged apart from the scan.Tests (oracle:
live_claims, per the testing doctrine)test_the_folds_agree_over_generated_graphs: a fixed-seed generated-graph property test — 2000 graphs of up to 8 nodes with cycles, self-loops, duplicate parent entries, unapplied named nodes, and duplicate-ID applied entries (the id(tag_claims): compacted_claims returns a claim twice when the applied list repeats an ID — the production fold diverges from live_claims on duplicate input #4359 shapes) — asserting fold equality on every case. The existing signed-history proptest intests/tag_claims.rscan only generate DAGs; this covers the raw-graph space.cargo test --lib tag_claims— 13 passed;cargo test --test tag_claims— 12 passed;cargo fmt --checkclean.🤖 Filed by repo-queue-worker Lane T in fallback mode (queue backend down 2026-11-06/07); the issue was the task.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.